home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD004b.dsk
/
KAFML.bas
< prev
next >
Wrap
BASIC Source File
|
2003-06-12
|
9KB
|
303 lines
5 REM KAFML (SELECT AND LIST)
7 DIM R$(1)
10 D$ = CHR$(4)
12 GOTO 7000
15 ONERR GOTO 9000
20 PRINT D$"OPEN "NF$",L"RL
30 PRINT D$"READ "NF$",R0"
50 INPUT H1: INPUT L1: INPUT CD$: INPUT BD$
51 H1 = H1 -1000
52 L1 = L1 -1000
55 POKE 216,0
60 PRINT D$
65 GOTO 8000
7000 ONERR GOTO 7700
7010 HOME
7020 PRINT "ENTER FILE NAME";
7030 INPUT NF$
7040 PRINT D$"OPEN SCMA-"NF$",L60"
7050 PRINT D$"READ SCMA-"NF$",R0"
7060 INPUT FP: INPUT TY$: INPUT NF$: INPUT RL: INPUT LR
7070 FP = FP -100
7075 INPUT NF: INPUT NV: INPUT ND: INPUT NS
7076 DIM NZ$(NF),TZ$(NF),RZ$(NF),LZ(NF),VZ(NF),DZ(NF),FZ$(NF)
7077 DIM LD(NF),VC$(20),SN(60)
7078 DIM MZ$(NV),VZ$(NV),DZ$(ND),SZ$(NS)
7079 NF = 0:NV = 0:ND = 0:NS = 0
7080 POKE 216,0
7090 PRINT D$
7091 PRINT "LOADING SCMA-";NF$: PRINT
7092 PRINT D$"READ SCMA-"NF$",R"FP
7100 INPUT FP: INPUT TY$:FP = FP -100
7120 IF TY$ = "N" GOTO 7500
7130 IF TY$ = "C" GOTO 7190
7140 IF TY$ = "V" GOTO 7350
7145 PRINT D$"CLOSE SCMA-"NF$
7150 GOTO 7600
7190 INPUT VP: INPUT DN$: INPUT RQ$: INPUT ML: INPUT DV$
7200 NF = NF +1
7210 NZ$(NF) = DN$
7220 TZ$(NF) = TY$
7230 RZ$(NF) = RQ$
7240 LZ(NF) = ML
7260 IF LEN(DV$) <6 GOTO 7300
7270 ND = ND +1
7280 DZ$(ND) = DV$
7285 DZ(NF) = ND +1000
7290 GOTO 7330
7300 NS = NS +1
7310 SZ$(NS) = DV$
7320 DZ(NF) = NS
7330 IF VP = 0 GOTO 7090
7340 CR = FP:FP = VP
7345 VZ(NF) = (NV +1) *1000
7348 GOTO 7090
7350 INPUT MV$: INPUT VV$
7360 NV = NV +1
7370 VZ$(NV) = VV$
7380 MZ$(NV) = MV$
7400 IF FP < >0 GOTO 7090
7410 FP = CR
7420 VZ(NF) = VZ(NF) +NV
7430 GOTO 7090
7500 INPUT DN$: INPUT RQ$: INPUT MN: INPUT MX: INPUT DV
7510 NF = NF +1
7520 NZ$(NF) = DN$
7530 TZ$(NF) = TY$
7540 RZ$(NF) = RQ$
7550 LZ(NF) = MN
7560 VZ(NF) = MX
7570 DZ(NF) = DV
7580 GOTO 7090
7600 GOTO 15
7700 PRINT D$
7710 POKE 216,0
7720 HOME
7730 PRINT "SCMA-";NF$;" NOT FOUND"
7740 PRINT "SCMA-";NF$;" IS REQUIRED"
7750 PRINT D$"DELETE SCMA-"NF$
7760 GOTO 9999
8000 HOME :I = 0
8002 I = I +1: IF I >NF GOTO 8006
8004 LD(I) = 0: GOTO 8002
8006 GOSUB 9400: INPUT "WANT ALL DATA FIELDS ON LIST?";R$
8008 IF R$ = "Y" GOTO 8038
8010 IF R$ = "N" GOTO 8014
8012 GOTO 8006
8014 GOSUB 9400: PRINT "TELL ME WHICH TO INCLUDE"
8016 GOSUB 9400: INPUT "ENTER DATA FIELD NAME ";VD$
8018 J = 0
8020 J = J +1: IF J >NF GOTO 8026
8022 IF VD$ = NZ$(J) GOTO 8028
8024 GOTO 8020
8026 PRINT VD$;" IS NOT A VALID DATA FIELD NAME": GOTO 8016
8028 LD(J) = 1
8030 INPUT "ANY MORE?";R$
8032 IF R$ = "Y" GOTO 8016
8034 IF R$ = "N" GOTO 8044
8036 GOTO 8030
8038 I = 0
8040 I = I +1: IF I >NF GOTO 8044
8042 LD(I) = 1: GOTO 8040
8044 CI = 0:SI = 0
8046 INPUT "WANT ALL RECORDS LISTED?";R$
8048 IF R$ = "Y" GOTO 8174
8050 IF R$ = "N" GOTO 8054
8052 GOTO 8046
8054 GOSUB 9400: PRINT "YOU MUST TELL ME WHICH TO SELECT"
8056 PRINT "EXAMPLE---SEX=M AND AGE>21"
8058 LO$ = " "
8060 GOSUB 9400: INPUT "ENTER DATA FIELD NAME ";VD$
8062 J = 0
8064 J = J +1: IF J >NF GOTO 8070
8066 IF VD$ = NZ$(J) GOTO 8072
8068 GOTO 8064
8070 PRINT VD$;" IS NOT A VALID DATA FIELD NAME": GOTO 8060
8072 SI = SI +1: IF SI >55 GOTO 8230
8074 SN(SI) = J
8076 GOSUB 9400: INPUT "ENTER OPERATOR < = # > ";OP$
8078 IF OP$ = "<" GOTO 8088
8080 IF OP$ = "=" GOTO 8088
8082 IF OP$ = "#" GOTO 8088
8084 IF OP$ = ">" GOTO 8088
8086 GOTO 8076
8088 SI = SI +1
8090 IF OP$ = "<" GOTO 8094
8091 IF OP$ = "=" GOTO 8095
8092 IF OP$ = "#" GOTO 8096
8093 IF OP$ = ">" GOTO 8097
8094 SN(SI) = 1: GOTO 8098
8095 SN(SI) = 2: GOTO 8098
8096 SN(SI) = 3: GOTO 8098
8097 SN(SI) = 4: GOTO 8098
8098 GOSUB 9400: PRINT "ENTER DATA VALUE ";
8100 IF TZ$(J) = "C" GOTO 8104
8102 INPUT VD: GOTO 8116
8104 INPUT VD$
8106 IF LEN(VD$) >5 GOTO 8112
8108 IF LEN(VD$) >LZ(J) GOTO 8114
8110 GOTO 8116
8112 PRINT "MAX OF 5 CHARACTERS ALLOWED": GOTO 8098
8114 PRINT "MAX LENGTH OF ";NZ$(J);" IS ";LZ(J): GOTO 8098
8116 SI = SI +1
8118 IF TZ$(J) = "N" GOTO 8124
8120 CI = CI +1: IF CI >20 GOTO 8230
8122 VC$(CI) = VD$:SN(SI) = CI: GOTO 8126
8124 SN(SI) = VD
8126 IF LO$ = "A" GOTO 8150
8128 IF LO$ = "O" GOTO 8152
8130 GOSUB 9400: INPUT "WANT TO TACK ON ANDS OR ORS?";R$
8132 IF R$ = "Y" GOTO 8138
8134 IF R$ = "N" GOTO 8161
8136 GOTO 8130
8138 GOSUB 9400: INPUT "WHICH? A = ANDS, O = ORS ";LO$
8140 IF LO$ = "A" GOTO 8146
8142 IF LO$ = "O" GOTO 8148
8144 GOTO 8138
8146 SI = SI +1:SN(SI) = 1: GOTO 8060
8148 SI = SI +1:SN(SI) = 2: GOTO 8060
8150 GOSUB 9400: PRINT "WANT TO TACK ON MORE ANDS?";: GOTO 8154
8152 GOSUB 9400: PRINT "WANT TO TACK ON MORE ORS?";
8154 INPUT R$
8156 IF R$ = "Y" GOTO 8140
8158 IF R$ = "N" GOTO 8161
8160 GOTO 8126
8161 GOSUB 9400: INPUT "WANT TO SPECIFY ADDITIONAL CRITERIA?";R$
8162 IF R$ = "Y" GOTO 8165
8163 IF R$ = "N" GOTO 8174
8164 GOTO 8161
8165 GOSUB 9400: PRINT "CRITERIA MUST BE CONNECTED BY AND OR OR"
8166 INPUT "WHICH? A=AND, O=OR ";SO$
8167 IF SO$ = "A" GOTO 8170
8168 IF SO$ = "O" GOTO 8172
8169 GOTO 8165
8170 SI = SI +1:SN(SI) = 10: GOTO 8058
8172 SI = SI +1:SN(SI) = 20: GOTO 8058
8174 SI = SI +1:SN(SI) = 99
8176 INPUT "TURN ON PRINTER & HIT RETURN";R$
8178 PRINT D$"PR#1"
8180 IF SN(1) = 99 GOTO 8300
8182 I = 0: PRINT : PRINT "SELECTION CRITERIA": GOSUB 9400
8184 I = I +1
8186 J = SN(I): PRINT NZ$(J);" ";:I = I +1
8188 IF SN(I) = 1 GOTO 8192
8189 IF SN(I) = 2 GOTO 8193
8190 IF SN(I) = 3 GOTO 8194
8191 IF SN(I) = 4 GOTO 8195
8192 R$ = "<": GOTO 8196
8193 R$ = "=": GOTO 8196
8194 R$ = "#": GOTO 8196
8195 R$ = ">": GOTO 8196
8196 PRINT R$;" ";
8198 IF TZ$(J) = "C" GOTO 8202
8200 I = I +1: PRINT SN(I): GOTO 8204
8202 I = I +1:K = SN(I): PRINT VC$(K)
8204 I = I +1: IF SN(I) = 99 GOTO 8220
8206 IF SN(I) >2 GOTO 8214
8208 IF SN(I) = 1 GOTO 8212
8210 PRINT " 0R": GOTO 8184
8212 PRINT " AND": GOTO 8184
8214 GOSUB 9400: IF SN(I) = 10 GOTO 8218
8216 PRINT : PRINT TAB( 18);"OR": PRINT : GOSUB 9400: GOTO 8184
8218 PRINT : PRINT TAB( 18);"AND": PRINT : GOSUB 9400: GOTO 8184
8220 GOSUB 9400
8221 PRINT D$"PR#0"
8222 INPUT "SATISFIED WITH CRITERIA?";R$
8224 IF R$ = "Y" GOTO 8300
8226 IF R$ = "N" GOTO 8229
8228 GOTO 8222
8229 HOME : PRINT "START CRITERIA OVER": GOSUB 9450: GOTO 8044
8230 PRINT "*** CRITERIA CAPACITY EXCEEDED": GOTO 9500
8300 REM
8310 PRINT D$"READ "NF$",R1"
8312 INPUT B: INPUT F:B = B -1000:F = F -1000
8314 IF F = H1 GOTO 9500
8315 PRINT "SEARCHING ";NF$: PRINT
8316 PRINT D$"READ "NF$",R"F
8318 INPUT B: INPUT F: INPUT A1$:B = B -1000:F = F -1000
8320 FZ$(1) = A1$:I = 1
8322 I = I +1: IF I >NF GOTO 8326
8324 INPUT FZ$(I): GOTO 8322
8326 IF SN(1) = 99 GOTO 8426
8328 J = 0
8329 J = J +1
8330 K = SN(J): IF TZ$(K) = "N" GOTO 8356
8332 J = J +1: IF SN(J) = 1 GOTO 8340
8334 IF SN(J) = 2 GOTO 8344
8336 IF SN(J) = 3 GOTO 8348
8338 IF SN(J) = 4 GOTO 8352
8340 J = J +1:L = SN(J): IF FZ$(K) <VC$(L) GOTO 8382
8342 GOTO 8384
8344 J = J +1:L = SN(J): IF FZ$(K) = VC$(L) GOTO 8382
8346 GOTO 8384
8348 J = J +1:L = SN(J): IF FZ$(K) < >VC$(L) GOTO 8382
8350 GOTO 8384
8352 J = J +1:L = SN(J): IF FZ$(K) >VC$(L) GOTO 8382
8354 GOTO 8384
8356 K = VAL(FZ$(K)):J = J +1
8358 IF SN(J) = 1 GOTO 8366
8360 IF SN(J) = 2 GOTO 8370
8362 IF SN(J) = 3 GOTO 8374
8364 IF SN(J) = 4 GOTO 8378
8366 J = J +1: IF K <SN(J) GOTO 8382
8368 GOTO 8384
8370 J = J +1: IF K = SN(J) GOTO 8382
8372 GOTO 8384
8374 J = J +1: IF K < >SN(J) GOTO 8382
8376 GOTO 8384
8378 J = J +1: IF K >SN(J) GOTO 8382
8380 GOTO 8384
8382 TV$ = "T": GOTO 8386
8384 TV$ = "F"
8386 J = J +1: IF SN(J) = 99 GOTO 8422
8388 IF SN(J) = 1 GOTO 8396
8390 IF SN(J) = 2 GOTO 8404
8392 IF SN(J) = 10 GOTO 8414
8394 IF SN(J) = 20 GOTO 8418
8396 IF TV$ = "T" GOTO 8329
8398 J = J +4: IF SN(J) = 1 GOTO 8398
8399 IF SN(J) = 99 GOTO 8314
8400 IF SN(J) = 10 GOTO 8314
8402 GOTO 8329
8404 IF TV$ = "F" GOTO 8329
8406 J = J +4: IF SN(J) = 2 GOTO 8406
8408 IF SN(J) = 99 GOTO 8426
8410 IF SN(J) = 20 GOTO 8426
8412 GOTO 8329
8414 IF TV$ = "T" GOTO 8329
8416 GOTO 8314
8418 IF TV$ = "F" GOTO 8329
8420 GOTO 8426
8422 IF TV$ = "T" GOTO 8426
8424 GOTO 8314
8426 PRINT D$"PR#1"
8427 GOSUB 9400:I = 0
8428 I = I +1: IF I >NF GOTO 8450
8430 IF LD(I) = 0 GOTO 8428
8432 PRINT NZ$(I); TAB( 16);FZ$(I);
8434 IF TZ$(I) = "C" GOTO 8438
8436 PRINT : GOTO 8428
8438 IF VZ(I) = 0 GOTO 8436
8440 X = INT(VZ(I)/1000):Y = VZ(I) -(X *1000)
8442 IF FZ$(I) = VZ$(X) GOTO 8448
8444 X = X +1: IF X >Y GOTO 8436
8446 GOTO 8442
8448 PRINT TAB( 24);MZ$(X): GOTO 8428
8450 PRINT D$"PR#0"
8452 GOTO 8314
9000 PRINT D$
9005 POKE 216,0
9010 HOME
9020 PRINT NF$;" NOT MOUNTED"
9100 PRINT "MOUNT DISKETTE WITH ";NF$;" AND RERUN"
9110 PRINT D$"DELETE "NF$
9120 GOTO 9999
9400 PRINT "--------------------";
9410 PRINT "-------------------": RETURN
9450 Q3 = 0
9460 Q3 = Q3 +1: IF Q3 >50 GOTO 9480
9470 GOTO 9460
9480 RETURN
9500 PRINT D$"CLOSE "NF$
9501 PRINT D$"PR#0"
9999 PRINT D$"RUN JELLO"